package de.solution.speichern;

import java.io.File;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;


import de.solution.stage.Stage;

/**
 * Speichert alle Objekte der Klasse Stage in eine XML-Datei.
 *  
 * @author The Solution
 */
public class SpeichernXML implements SpeichernInterface {

	@Override
	public void save(Stage stage, File file) throws JAXBException{
		JAXBContext jc = JAXBContext.newInstance(Stage.class);
	    Marshaller m = jc.createMarshaller();
	    m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
	    m.marshal(stage, file);
		
	}

}
